﻿using ScannerWatcher.Service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Resources;
using System.Text;
using System.Windows.Forms;

namespace ScannerWatcher
{
    public partial class FrmNotify : Form
    {
        FrmMain frmMain = null;
        public FrmNotify()
        {
            InitializeComponent();

            this.WindowState = FormWindowState.Minimized;
            this.ShowInTaskbar = false;

            frmMain = new FrmMain();

            fileSystemWatcher1.Path = Settings.ScanPath;
            fileSystemWatcher1.EnableRaisingEvents = true;
        }

        private void 显示主界面ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmMain.ShowMain("");
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            notifyIcon1.Visible = false;
            Application.Exit();
        }

        private void fileSystemWatcher1_Created(object sender, System.IO.FileSystemEventArgs e)
        {
            frmMain.ShowMain(e.FullPath);
        }
    }
}
